package com.ojoin.ojoin.eb_spider.queue;

import com.ojoin.ojoin.eb_spider.bean.CiMingUserOrder;
import com.ojoin.ojoin.eb_spider.bean.TJUserOrder;
import com.ojoin.ojoin.eb_spider.domain.AssistCatchData;
import com.ojoin.ojoin.eb_spider.service.StatTotalService;
import com.ojoin.ojoin.eb_spider.service.WebDriveBaseService;
import com.ojoin.ojoin.eb_spider.service.impl.SLDataCatchBaseServiceImpl;
import com.ojoin.ojoin.eb_spider.utils.SpringUtilsSpider;
import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.utils.LogUtils;
import com.ojoin.trade.supplyloan_core.web.domain.CatchDataStartMessage;
import com.ojoin.trade.supplyloan_core.web.domain.Order;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlLoanStatTotal;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Repository;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.ObjectMessage;
import java.util.UUID;

/**
 * 
 * @author liang
 * @description 队列消息监听器
 * 
 */
@Repository
public class ReceiverAppointmentListener extends BaseReceiverListener {

	private static Logger log = LoggerFactory
			.getLogger(ReceiverAppointmentListener.class);

	public void deal(Object ob) throws BusinessException, Exception {
		if (ob instanceof TJUserOrder) {
			TJUserOrder st = (TJUserOrder) ob;
			CiMingUserOrder co = new CiMingUserOrder(st);
			WebDriveBaseService service = SpringUtilsSpider
					.getBeanByClassName("CiMingAppointmentServiceImpl");
			
			service.repairDeal(co);

		} else {
			LogUtils.info(log, "列别不匹配");
		}
	}

}
